import request from '@/utils/request';
import store from "@/store";

const env = import.meta.env.MODE || 'development';
const prefix = '';

// 列表 /apiapp/v1/product/list
export function productListApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/product/list`,
    method: 'get',
    params
  });
}

// 详情 /apiapp/v1/product/details
export function productDetailApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/product/details`,
    method: 'get',
    params
  });
}

// 新增 /apiapp/v1/product/create
export function productCreateApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/product/create`,
    method: 'post',
    data
  });
}

// 编辑 /apiapp/v1/product/edit
export function productEditApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/product/edit?id=${data.id}`,
    method: 'post',
    data
  });
}

// 删除 /apiapp/v1/product/delete
export function productDeleteApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/product/delete`,
    method: 'post',
    data
  });
}

// 移除（删除回收站数据） /apiapp/v1/product/remove
export function productRemoveApi (data) {
  return request({
    url: `${prefix}/apiapp/v1/product/remove`,
    method: 'post',
    data
  });
}
